package cc.rengu.igas.momp.core.service.trans;

import cc.rengu.igas.momp.common.constant.CommonConstant;
import cc.rengu.igas.momp.common.dao.*;
import cc.rengu.igas.momp.common.dao.impl.*;
import cc.rengu.igas.momp.common.entity.*;
import cc.rengu.igas.momp.common.enums.*;
import cc.rengu.igas.momp.common.model.bean.*;
import cc.rengu.igas.momp.common.util.CommonMessageCheck;
import cc.rengu.igas.momp.common.util.JsonOperation;
import cc.rengu.igas.momp.facade.bean.*;
import cc.rengu.igas.momp.facade.request.QueryCashierCashbackMcDetailInfoRequest;
import cc.rengu.igas.momp.facade.response.QueryCashierCashbackMcDetailInfoResponse;
import cc.rengu.oltp.service.base.RadpService;
import cc.rengu.oltp.service.common.constant.TreeNodeConstant;
import cc.rengu.oltp.service.common.dao.SysParamMapper;
import cc.rengu.oltp.service.common.dao.impl.SysParamMapperImpl;
import cc.rengu.oltp.service.common.entity.SysParam;
import cc.rengu.oltp.service.common.enums.ChannelEnum;
import cc.rengu.oltp.service.common.enums.OltpRpcdEnum;
import cc.rengu.oltp.service.model.BizException;
import cc.rengu.oltp.service.model.BizResponse;
import cc.rengu.oltp.utility.bean.PageInfo;
import cc.rengu.oltp.utility.bean.PageResult;
import cc.rengu.oltp.utility.util.ConvertUtil;
import cc.rengu.oltp.utility.util.XmlTreeUtil;
import cc.rengu.utility.base.StringUtil;

import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Jinan Liu
 * @date 2020/3/24 15:19
 * @description 收银员返现类营销活动详细信息查询功能实现
 */
public class QueryCashierCashbackMcDetailInfoService extends RadpService {

    private String globalInstId;
    private String globalQueryType;
    private String globalQueryRole;
    private String globalQueryId;
    private String globalQueryOrgId;
    private String globalMcNo;

    @Override
    protected int bizInit(String s) {
        return CommonConstant.PROCESS_SUCCESS;
    }

    @Override
    protected int bizProcess(String s, int i) {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();

        try {
            QueryCashierCashbackMcDetailInfoRequest queryCashierCashbackMcDetailInfoRequest = new QueryCashierCashbackMcDetailInfoRequest();
            ConvertUtil.convertOutput(queryCashierCashbackMcDetailInfoRequest);

            QueryCashierCashbackMcDetailInfoResponse queryCashierCashbackMcDetailInfoResponse = new QueryCashierCashbackMcDetailInfoResponse();
            queryCashierCashbackMcDetailInfoResponse.setHeader(queryCashierCashbackMcDetailInfoRequest.getHeader());
            BizResponse<QueryCashierCashbackMcDetailInfoResponse> bizResponse = new BizResponse<>();
            bizResponse.setResult(queryCashierCashbackMcDetailInfoResponse);

            String timeStamp = new SimpleDateFormat(CommonConstant.TIMESTAMP_FORMAT).format(new Date());
            globalQueryType = queryCashierCashbackMcDetailInfoRequest.getQueryType();
            globalQueryId = queryCashierCashbackMcDetailInfoRequest.getQueryId();
            globalQueryOrgId = queryCashierCashbackMcDetailInfoRequest.getQueryOrgId();
            globalQueryRole = queryCashierCashbackMcDetailInfoRequest.getQueryRole();
            globalInstId = queryCashierCashbackMcDetailInfoRequest.getHeader().getInstId();
            globalMcNo = queryCashierCashbackMcDetailInfoRequest.getMcNo();
            rglog.info("机构<{}>在<{}>由<{}>开始查询收银员返现活动详细信息流程", globalInstId, timeStamp, globalQueryId);

            /* 报文检查 */
            CommonMessageCheck.checkBizMessageHeader(globalQueryType, globalQueryId, globalQueryRole, rglog);

            /* 检查操作员所属机构号 */
            if (StringUtil.isNullorEmpty(globalQueryOrgId)) {
                rglog.error("法人机构号<{}>的操作员<{}>的所属机构为空!", globalInstId, globalQueryId);
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }

            /* 检查营销活动编号 */
            if (StringUtil.isNullorEmpty(globalMcNo)) {
                rglog.error("法人机构号<{}>的操作员<{}>的营销活动编号为空!", globalInstId, globalQueryId);
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }

            // 服务调用
            BizResponse<QueryCashierCashbackMcDetailInfoResponse> bizResponseNew = queryCashierCashbackMcDetailInfo(xmlTreeUtil, queryCashierCashbackMcDetailInfoRequest, queryCashierCashbackMcDetailInfoResponse);

            ConvertUtil.convertInput(bizResponseNew.getResult());

        } catch (BizException e) {
            try {
                xmlTreeUtil.setXmlTreeStringValue(TreeNodeConstant.RESP_CODE, e.getCode());
                xmlTreeUtil.setXmlTreeStringValue(TreeNodeConstant.RESP_DESC, e.getMessage());
                xmlTreeUtil.setXmlTreeStringValue(CommonConstant.KEY_RESPDESC, e.getMessage());
            } catch (Exception e1) {
                rglog.error(StringUtil.ExceptionToString(e1));
            }
        } catch (Exception e) {
            rglog.error(StringUtil.ExceptionToString(e));
            try {
                xmlTreeUtil.setXmlTreeStringValue(TreeNodeConstant.RESP_CODE, OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                xmlTreeUtil.setXmlTreeStringValue(TreeNodeConstant.RESP_DESC, OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
                xmlTreeUtil.setXmlTreeStringValue(CommonConstant.KEY_RESPDESC, e.getMessage());
            } catch (Exception e1) {
                rglog.error(StringUtil.ExceptionToString(e));
            }
        }

        return CommonConstant.PROCESS_SUCCESS;
    }

    @Override
    protected int bizTerminate(String s) {
        return CommonConstant.PROCESS_SUCCESS;
    }

    /**
     * 查询收银员返现类营销活动详细信息
     *
     * @param xmlTreeUtil                              内部XML树
     * @param queryCashierCashbackMcDetailInfoRequest  收银员返现类活动详情查询接口请求对象
     * @param queryCashierCashbackMcDetailInfoResponse 收银员返现类活动详情查询接口应答对象
     * @return cc.rengu.oltp.service.model.BizResponse<cc.rengu.igas.momp.facade.response.QueryMchntFeeDiscountMcDetailInfoResponse> 收银员返现活动详情查询接口应答对象
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 14:50
     */
    private BizResponse<QueryCashierCashbackMcDetailInfoResponse> queryCashierCashbackMcDetailInfo(XmlTreeUtil xmlTreeUtil, QueryCashierCashbackMcDetailInfoRequest queryCashierCashbackMcDetailInfoRequest, QueryCashierCashbackMcDetailInfoResponse queryCashierCashbackMcDetailInfoResponse) throws Exception {

        BizResponse<QueryCashierCashbackMcDetailInfoResponse> bizResponse = new BizResponse<>();
        /* 判断查询类型 */
        CcbMcListInfoInObj ccbMcListInfoInObj = new CcbMcListInfoInObj();
        /* 机构编码 */
        ccbMcListInfoInObj.setInstId(globalInstId);
        /* 营销活动编号 */
        ccbMcListInfoInObj.setMcNo(globalMcNo);
        /* 机构编号 */
        if (!StringUtil.isNullorEmpty(globalQueryOrgId)) {
            ccbMcListInfoInObj.setOrgId(globalQueryOrgId);
        }

        /* 根据角色权限查询数据 */
        if (QueryTypeEnum.BANK_QUERY_TYPE.getQueryTypeCode().equals(globalQueryType) ||
                QueryTypeEnum.MCHNT_QYERY_TYPE.getQueryTypeCode().equals(globalQueryType) ||
                QueryTypeEnum.CASHIER_QYERY_TYPE.getQueryTypeCode().equals(globalQueryType)) {

            /* 查询营销活动详细信息 */
            queryCashierCashbackMcDetailInfo(queryCashierCashbackMcDetailInfoResponse, ccbMcListInfoInObj);
        } else {
            /* 其他查询角色不支持 */
            rglog.error("当前<{}>角色的查询用户<{}>无权限操作数据!", globalQueryRole, globalQueryType);
            throw new BizException(RespCodeEnum.NO_AUTHORIZATION_TO_OPER_ERROR.getRespCode(), RespCodeEnum.NO_AUTHORIZATION_TO_OPER_ERROR.getRespDesc());
        }

        bizResponse.setRspSysId(ChannelEnum.MOMP.getChannelType());
        bizResponse.setRespCode(RespCodeEnum.TRANS_SUCCESS.getRespCode());
        bizResponse.setRespDesc(RespCodeEnum.TRANS_SUCCESS.getRespDesc());

        queryCashierCashbackMcDetailInfoResponse.setRespCode(RespCodeEnum.TRANS_SUCCESS.getRespCode());
        queryCashierCashbackMcDetailInfoResponse.setRespDesc(RespCodeEnum.TRANS_SUCCESS.getRespDesc());
        bizResponse.setResult(queryCashierCashbackMcDetailInfoResponse);

        return bizResponse;
    }

    /**
     * 银行人员查询收银员活动详细信息
     *
     * @param queryCashierCashbackMcDetailInfoResponse 商户手续费商户手续费减免类活动详情查询接口应答对象
     * @param ccbMcListInfoInObj                       营销活动列表查询使用实体类入参
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 18:58
     */
    private void queryCashierCashbackMcDetailInfo(QueryCashierCashbackMcDetailInfoResponse queryCashierCashbackMcDetailInfoResponse, CcbMcListInfoInObj ccbMcListInfoInObj) throws Exception {

        if (QueryRoleEnum.BANK_BASIC_QUERY_ROLE.getQueryRoleCode().equals(globalQueryRole) ||
                QueryRoleEnum.BANK_PUBLISH_QYERY_ROLE.getQueryRoleCode().equals(globalQueryRole) ||
                QueryRoleEnum.MCHNT_QYERY_ROLE.getQueryRoleCode().equals(globalQueryRole) ||
                QueryRoleEnum.CASHIER_QYERY_ROLE.getQueryRoleCode().equals(globalQueryRole)) {

            /* 从正式表查询数据,除了营销活动基本表外其他表查询语句相同 */
            TMMcCashierCashbackInfo tmMcCashierCashbackInfo = selectMfdMcDetailInfoByBankBasicRole(ccbMcListInfoInObj);
            if (null == tmMcCashierCashbackInfo) {
                rglog.error("机构<{}>的收银员返现类营销活动<{}>的基本信息查询失败!用户无权限查看数据或不存在该营销活动", globalInstId, globalMcNo);
                throw new BizException(RespCodeEnum.GET_CASHIER_CASHBACK_MC_DETAIL_ERROR.getRespCode(), RespCodeEnum.GET_CASHIER_CASHBACK_MC_DETAIL_ERROR.getRespDesc());
            }

            /* 查询营销活动机构信息 */
            List<TMMcOrgInfo> mcOrgInfoList = getAllMcOrgListInfo();



            /* 查询营销活动规则信息 */
            List<TMMcCashierCashbackRuleInfo> tmMcCashierCashbackRuleInfo = getAllMcRuleListInfo();

            /* 查询营销活动支付产品信息 */
            List<TMMcProductInfo> mcProductInfoList = getAllMcProductListInfo();

            /* 拼接交易信息 */
            CashierCashbackMcInfoBean cashierCashbackMcInfoBean = convertMcInfo(tmMcCashierCashbackInfo);
            queryCashierCashbackMcDetailInfoResponse.setMcInfoObj(cashierCashbackMcInfoBean);
            List<McOrgInfoBean> mcOrgInfoBeanList = mcOrgInfoList.stream().map(this::convertMcOrgInfo).collect(Collectors.toList());
            queryCashierCashbackMcDetailInfoResponse.setOrgInfoList(mcOrgInfoBeanList);

            /* 查询营销活动商户信息 */
            /*
            //去除商户信息 用户信息返回内容
            List<Object> mcMchntInfoList = getAllMcMchntListInfo();
            List<McMchntInfoBean> mcMchntInfoBeanList = new ArrayList<>();
            if(null != mcMchntInfoList && !mcMchntInfoList.isEmpty()){
                mcMchntInfoBeanList = mcMchntInfoList.stream().map(this::convertMcMchntInfo).collect(Collectors.toList());
            }
            queryCashierCashbackMcDetailInfoResponse.setMchntInfoList(mcMchntInfoBeanList);
            */

            List<CashierCashbackRuleInfoBean> cashierCashbackRuleInfoBeans = new ArrayList<>();
            if (null != tmMcCashierCashbackRuleInfo && !tmMcCashierCashbackRuleInfo.isEmpty()) {
                cashierCashbackRuleInfoBeans = tmMcCashierCashbackRuleInfo.stream().map(this::convertMcRuleInfo).collect(Collectors.toList());
            }
            queryCashierCashbackMcDetailInfoResponse.setRuleInfoList(cashierCashbackRuleInfoBeans);
            List<McProductInfoBean> mcProductInfoBeanList = new ArrayList<>();
            if (null != mcProductInfoList && !mcProductInfoList.isEmpty()) {
                mcProductInfoBeanList = mcProductInfoList.stream().map(this::convertMcProductInfo).collect(Collectors.toList());
            }
            queryCashierCashbackMcDetailInfoResponse.setProductInfoList(mcProductInfoBeanList);

        } else if (QueryRoleEnum.BANK_AUDIT_QYERY_ROLE.getQueryRoleCode().equals(globalQueryRole)) {

            /* 银行审批岗流程 */
            TMPlatBizTmp tmPlatBizTmp = selectCashDetailInfoByBankAuditRole(ccbMcListInfoInObj);
            if (null == tmPlatBizTmp) {
                rglog.error("机构<{}>的收银员返现营销活动<{}>的基本信息查询失败!用户无权限查看数据或不存在该营销活动", globalInstId, globalMcNo);
                throw new BizException(RespCodeEnum.GET_MONEY_OFF_MC_DETAIL_ERROR.getRespCode(), RespCodeEnum.GET_MONEY_OFF_MC_DETAIL_ERROR.getRespDesc());
            }

            /* 取临时表中所有数据 */
            CcbMcListInfoInObj ccbMcListInfoInObj1 = new CcbMcListInfoInObj();
            ccbMcListInfoInObj1.setInstId(globalInstId);
            ccbMcListInfoInObj1.setMcNo(globalMcNo);
            List<TMPlatBizTmp> tmPlatBizTmpList = getAllMcTmpInfo(ccbMcListInfoInObj1);
            if (null == tmPlatBizTmpList || tmPlatBizTmpList.isEmpty()) {
                rglog.error("机构<{}>的收银员返现类营销活动<{}>的基本信息查询失败!用户无权限查看数据或不存在该营销活动", globalInstId, globalMcNo);
                throw new BizException(RespCodeEnum.GET_MONEY_OFF_MC_DETAIL_ERROR.getRespCode(), RespCodeEnum.GET_MONEY_OFF_MC_DETAIL_ERROR.getRespDesc());
            }


            /* 转换营销活动基本信息 */
            CashierCashbackMcInfoBean cashierCashbackMcInfoBean = convertTmpMcInfo(tmPlatBizTmp);

            /* 转换营销活动机构信息 */
            List<TMPlatBizTmp> tmPlatBizTmpOrgList = tmPlatBizTmpList.stream().filter(record -> TableNameEnum.T_M_MC_ORG_INFO.getTableNameCode().equals(record.getOprTableEname())).collect(Collectors.toList());
            List<McOrgInfoBean> mcOrgInfoBeanList = tmPlatBizTmpOrgList.stream().map(this::convertTmpMcOrgInfo).collect(Collectors.toList());
            /** 去除商户信息 用户信息返回内容 */
            /* 查询营销活动商户信息 */
            /*List<TMPlatBizTmp> tmPlatBizTmpMchntList = tmPlatBizTmpList.stream().filter(record -> TableNameEnum.T_M_MC_MCHNT_INFO.getTableNameCode().equals(record.getOprTableEname())).collect(Collectors.toList());
            List<McMchntInfoBean> mcMchntInfoBeanList = tmPlatBizTmpMchntList.stream().map(this::convertTmpMcMchntInfo).collect(Collectors.toList());
            queryCashierCashbackMcDetailInfoResponse.setMchntInfoList(mcMchntInfoBeanList);
            */

            /* 查询营销活动规则信息 */
            List<TMPlatBizTmp> tmPlatBizTmpRuleList = tmPlatBizTmpList.stream().filter(record -> TableNameEnum.T_M_MC_CCB_RULE_INFO.getTableNameCode().equals(record.getOprTableEname())).collect(Collectors.toList());
            List<CashierCashbackRuleInfoBean> cashierCashbackRuleInfoBeans = tmPlatBizTmpRuleList.stream().map(this::convertTmpMcRuleInfo).collect(Collectors.toList());

            /* 查询营销活动支付产品信息 */
            List<TMPlatBizTmp> tmPlatBizTmpProdList = tmPlatBizTmpList.stream().filter(record -> TableNameEnum.T_M_MC_PROD_INFO.getTableNameCode().equals(record.getOprTableEname())).collect(Collectors.toList());
            List<McProductInfoBean> mcProductInfoBeanList = tmPlatBizTmpProdList.stream().map(this::convertTmpMcProductInfo).collect(Collectors.toList());


            /* 拼接交易信息 */
            queryCashierCashbackMcDetailInfoResponse.setMcInfoObj(cashierCashbackMcInfoBean);
            queryCashierCashbackMcDetailInfoResponse.setOrgInfoList(mcOrgInfoBeanList);
            queryCashierCashbackMcDetailInfoResponse.setRuleInfoList(cashierCashbackRuleInfoBeans);
            queryCashierCashbackMcDetailInfoResponse.setProductInfoList(mcProductInfoBeanList);

        } else {
            /* 其他查询角色不支持 */
            rglog.error("当前<{}>角色的查询用户<{}>无权限操作数据!", globalQueryRole, globalQueryType);
            throw new BizException(RespCodeEnum.NO_AUTHORIZATION_TO_OPER_ERROR.getRespCode(), RespCodeEnum.NO_AUTHORIZATION_TO_OPER_ERROR.getRespDesc());
        }

    }

    /**
     * 银行操作员查询营销活动基本信息表数据(正式表)
     *
     * @param ccbMcListInfoInObj 营销活动列表查询使用实体类入参
     * @return cc.rengu.igas.momp.common.entity.TMMcMchntFeeDiscountInfo 商户手续费减免类营销活动信息表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 19:11
     */
    private TMMcCashierCashbackInfo selectMfdMcDetailInfoByBankBasicRole(CcbMcListInfoInObj ccbMcListInfoInObj) throws Exception {
        McDetailInfoMapper mcDetailInfoMapper = new McDetailInfoMapperImpl();
        return mcDetailInfoMapper.selectCashierCashDetailInfoByBankBasicRole(ccbMcListInfoInObj);
    }

    /**
     * 获取营销活动机构信息列表(正式表)
     *
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcOrgInfo> 营销活动机构信息表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 18:36
     */
    private List<TMMcOrgInfo> getAllMcOrgListInfo() throws Exception {

        McOrgInfoMapper mcOrgInfoMapper = new McOrgInfoMapperImpl();
        return mcOrgInfoMapper.selectMcOrgInfoList(globalInstId, globalMcNo);
    }

    /**
     * 获取营销活动商户信息列表(正式表)
     *
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcMchntInfo> 营销活动商户信息表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 18:35
     */
    private List<Object> getAllMcMchntListInfo() throws Exception {
        List<Object> tmMcMchntInfoList = new ArrayList<>();
        PageInfo pageInfo = new PageInfo();
        int i = 0;
        pageInfo.setPageIndex(i);
        pageInfo.setPageSize(9999);
        TMMcMchntInfo tmMcMchntInfo = new TMMcMchntInfo();
        tmMcMchntInfo.setInstId(globalInstId);
        tmMcMchntInfo.setMcNo(globalMcNo);
        McMchntInfoMapper mcMchntInfoMapper = new McMchntInfoMapperImpl();
        PageResult tmMcMchntInfoPageInfo = mcMchntInfoMapper.selectMcMchntInfoList(tmMcMchntInfo, pageInfo);
        if (null != tmMcMchntInfoPageInfo && null != tmMcMchntInfoPageInfo.getResult()) {
            tmMcMchntInfoList.addAll(tmMcMchntInfoPageInfo.getResult());
        }
        while (null != tmMcMchntInfoPageInfo && null != tmMcMchntInfoPageInfo.getResult() && tmMcMchntInfoPageInfo.getResult().size() >= 1) {
            i++;
            pageInfo.setPageIndex(i);
            tmMcMchntInfoPageInfo = mcMchntInfoMapper.selectMcMchntInfoList(tmMcMchntInfo, pageInfo);
            if (null != tmMcMchntInfoPageInfo && null != tmMcMchntInfoPageInfo.getResult()) {
                tmMcMchntInfoList.addAll(tmMcMchntInfoPageInfo.getResult());
            }
        }
        return tmMcMchntInfoList;
    }

    /**
     * 获取营销活动规则信息列表(正式表)
     *
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcMoneyOffRuleInfo> 减免类营销活动规则表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 18:40
     */
    private List<TMMcCashierCashbackRuleInfo> getAllMcRuleListInfo() throws Exception {

        McRuleInfoMapper mcRuleInfoMapper = new McRuleInfoMapperImpl();
        return mcRuleInfoMapper.selectCashierCashbackRuleInfoList(globalInstId, globalMcNo);
    }

    /**
     * 获取营销活动支付产品信息列表(正式表)
     *
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcProductInfo> 营销活动产品信息表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 18:41
     */
    private List<TMMcProductInfo> getAllMcProductListInfo() throws Exception {

        McProductInfoMapper mcProductInfoMapper = new McProductInfoMapperImpl();
        return mcProductInfoMapper.selectMcProductInfoList(globalInstId, globalMcNo);
    }

    /**
     * 银行审批岗获取指定营销活动所有待审批数据
     *
     * @param ccbMcListInfoInObj 营销活动列表查询使用实体类入参
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMPlatBizTmp> 业务数据临时表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 19:55
     */
    private List<TMPlatBizTmp> getAllMcTmpInfo(CcbMcListInfoInObj ccbMcListInfoInObj) throws Exception {

        PlatBizTmpMapper platBizTmpMapper = new PlatBizTmpMapperImpl();
        return platBizTmpMapper.selectCashierDetailInfoByBankAuditRole(ccbMcListInfoInObj);
    }

    /**
     * 营销活动信息数据库实体类和接口实体类数据转换
     *
     * @param tmMcCashierCashbackInfo 收银员返现类营销活动信息表
     * @return cc.rengu.igas.momp.facade.bean.MoneyOffMcInfoBean 收银员返现活动基本信息对象
     * @author Jinan Liu
     * @date 2020/4/1 10:27
     */
    private CashierCashbackMcInfoBean convertMcInfo(TMMcCashierCashbackInfo tmMcCashierCashbackInfo) {
        CashierCashbackMcInfoBean cashierCashbackMcInfoBean = new CashierCashbackMcInfoBean();
        try {
            /* 营销活动编号 */
            cashierCashbackMcInfoBean.setMcNo(tmMcCashierCashbackInfo.getMcNo());
            /* 营销活动名称 */
            cashierCashbackMcInfoBean.setMcName(tmMcCashierCashbackInfo.getMcName());
            /* 营销活动类型 */
            cashierCashbackMcInfoBean.setMcType(tmMcCashierCashbackInfo.getMcType());
            /* 营销活动状态 */
            cashierCashbackMcInfoBean.setMcStatus(tmMcCashierCashbackInfo.getMcStatus());
            /* 活动起始日期 */
            cashierCashbackMcInfoBean.setMcStartDate(tmMcCashierCashbackInfo.getMcStartDate());
            /* 活动截止日期 */
            cashierCashbackMcInfoBean.setMcEndDate(tmMcCashierCashbackInfo.getMcEndDate());
            /* 活动结束日期 */
            cashierCashbackMcInfoBean.setMcActualEndDate(tmMcCashierCashbackInfo.getMcActualEndDate());
            /* 预算 */
            cashierCashbackMcInfoBean.setBudget(tmMcCashierCashbackInfo.getBudget());
            /* 优惠打款模式 */
            cashierCashbackMcInfoBean.setDiscountTransferMode(tmMcCashierCashbackInfo.getDiscountTransferMode());
            /* 达标条件 */
            cashierCashbackMcInfoBean.setCriteriaFlag(tmMcCashierCashbackInfo.getCriteriaFlag());
            /* 有效交易定义 */
            cashierCashbackMcInfoBean.setCriteriaLimit(tmMcCashierCashbackInfo.getCriteriaLimit());
            /* 统计周期 */
            cashierCashbackMcInfoBean.setStatPeriod(tmMcCashierCashbackInfo.getStatPeriod());
            /* 达标交易金额 */
            cashierCashbackMcInfoBean.setCriteriaAmount(tmMcCashierCashbackInfo.getCriteriaAmount());
            /* 达标交易笔数 */
            cashierCashbackMcInfoBean.setCriteriaQuantity(tmMcCashierCashbackInfo.getCriteriaQuantity());
            /* 优惠退出标志 */
            cashierCashbackMcInfoBean.setTerminationFlagPerson(tmMcCashierCashbackInfo.getTerminationFlagPerson());
            /* 交易笔数上限 */
            cashierCashbackMcInfoBean.setQuantityLimitPerson(tmMcCashierCashbackInfo.getQuantityLimitP());
            /* 交易金额上限 */
            cashierCashbackMcInfoBean.setAmountLimitPerson(tmMcCashierCashbackInfo.getAmountLimitP());
            /* 返现金额上限 */
            cashierCashbackMcInfoBean.setCashbackLimitPerson(tmMcCashierCashbackInfo.getCashbackLimitP());
            /* 优惠退出标志 */
            cashierCashbackMcInfoBean.setTerminationFlagMc(tmMcCashierCashbackInfo.getTerminationFlagMc());
            /* 交易笔数上限 */
            cashierCashbackMcInfoBean.setQuantityLimitMc(tmMcCashierCashbackInfo.getQuantityLimitMc());
            /* 交易金额上限 */
            cashierCashbackMcInfoBean.setAmountLimitMc(tmMcCashierCashbackInfo.getAmountLimitMc());
            /* 返现金额上限 */
            cashierCashbackMcInfoBean.setCashbackLimitMc(tmMcCashierCashbackInfo.getCashbackLimitMc());
            /* 交易金额上限 */
            cashierCashbackMcInfoBean.setCashbackMethod(tmMcCashierCashbackInfo.getCashbackMethod());


            /* 审批状态   */
            cashierCashbackMcInfoBean.setAuditStatus(tmMcCashierCashbackInfo.getAuditStatus());
            /* 创建人 */
            cashierCashbackMcInfoBean.setOprId(tmMcCashierCashbackInfo.getOprId());
            /* 创建时间 */
            cashierCashbackMcInfoBean.setCreateTime(tmMcCashierCashbackInfo.getCreateTime());
            /* 最后修改人 */
            cashierCashbackMcInfoBean.setLastOprId(tmMcCashierCashbackInfo.getLastOprId());
            /* 修改时间 */
            cashierCashbackMcInfoBean.setUpdateTime(tmMcCashierCashbackInfo.getUpdateTime());
            /* 审批拒绝原因 */
            cashierCashbackMcInfoBean.setAuditRefuseReason(tmMcCashierCashbackInfo.getAuditRefuseReason());
            /* 发布拒绝原因 */
            cashierCashbackMcInfoBean.setPublishRefuseReason(tmMcCashierCashbackInfo.getPublishRefuseReason());
            /* 备用字段1 */
            cashierCashbackMcInfoBean.setRemark1(tmMcCashierCashbackInfo.getRemark1());
            /* 备用字段2 */
            cashierCashbackMcInfoBean.setRemark2(tmMcCashierCashbackInfo.getRemark2());
            /* 备用字段3 */
            cashierCashbackMcInfoBean.setRemark2(tmMcCashierCashbackInfo.getRemark3());
            /* 备用字段4 */
            cashierCashbackMcInfoBean.setRemark2(tmMcCashierCashbackInfo.getRemark4());
            /* 备用字段5 */
            cashierCashbackMcInfoBean.setRemark2(tmMcCashierCashbackInfo.getRemark5());
            //积分规则json字符串
            cashierCashbackMcInfoBean.setPointRuleData(tmMcCashierCashbackInfo.getPointRuleData());
            //强制终止原因
            cashierCashbackMcInfoBean.setNfrcTmnlRsn(tmMcCashierCashbackInfo.getNfrcTmnlRsn());

        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("转换营销活动信息异常,异常信息:<{}>", byteArrayOutputStream.toString());
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }

        return cashierCashbackMcInfoBean;
    }

    /**
     * 营销活动机构信息数据库实体类和接口实体类数据转换
     *
     * @param mcOrgInfo 营销活动机构信息表
     * @return cc.rengu.igas.momp.facade.bean.McOrgInfoBean 营销活动机构信息对象
     * @author Jinan Liu
     * @date 2020/4/1 10:33
     */
    private McOrgInfoBean convertMcOrgInfo(TMMcOrgInfo mcOrgInfo) {
        McOrgInfoBean mcOrgInfoBean = new McOrgInfoBean();
        try {
            /* 机构编号 */
            mcOrgInfoBean.setOrgId(mcOrgInfo.getOrgId());
            /* 机构层级 */
            mcOrgInfoBean.setOrgHierarchy(mcOrgInfo.getOrgHierarchy());
            /* 机构名称 */
            mcOrgInfoBean.setOrgName(mcOrgInfo.getOrgName());

        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("转换营销活动机构信息异常,异常信息:<{}>", byteArrayOutputStream.toString());
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }

        return mcOrgInfoBean;
    }

    /**
     * 营销活动商户信息数据库实体类和接口实体类数据转换
     *
     * @param object 营销活动商户信息表
     * @return cc.rengu.igas.momp.facade.bean.McMchntInfoBean 营销活动商户信息对象
     * @author Jinan Liu
     * @date 2020/4/1 10:33
     */
    private McMchntInfoBean convertMcMchntInfo(Object object) {
        McMchntInfoBean mcMchntInfoBean = new McMchntInfoBean();
        TMMcMchntInfo mcMchntInfo = (TMMcMchntInfo) object;
        try {
            /* 商户范围类型 */
            mcMchntInfoBean.setMchntType(mcMchntInfo.getMchntType());
            /* 商户范围号 */
            mcMchntInfoBean.setMchntNo(mcMchntInfo.getMchntNo());
            /* 商户范围名称 */
            mcMchntInfoBean.setMchntName(mcMchntInfo.getMchntName());

        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("转换营销活动商户信息异常,异常信息:<{}>", byteArrayOutputStream.toString());
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }

        return mcMchntInfoBean;
    }

    /**
     * 营销活动规则信息数据库实体类和接口实体类数据转换
     *
     * @param cashierCashbackRuleInfo 收银员返现活动规则表
     * @return cc.rengu.igas.momp.facade.bean.MoneyOffRuleInfoBean 收银员返现活动规则信息对象
     * @author Jinan Liu
     * @date 2020/4/1 10:32
     */
    private CashierCashbackRuleInfoBean convertMcRuleInfo(TMMcCashierCashbackRuleInfo cashierCashbackRuleInfo) {

        CashierCashbackRuleInfoBean cashierCashbackRuleInfoBean = new CashierCashbackRuleInfoBean();

        try {

            /* 顺序号  */
            cashierCashbackRuleInfoBean.setRuleIndex(cashierCashbackRuleInfo.getRuleIndex());
            /* 优惠力度下限 */
            cashierCashbackRuleInfoBean.setCriteriaFloor(cashierCashbackRuleInfo.getCriteriaFloor());
            /* 优惠力度上限 */
            cashierCashbackRuleInfoBean.setCriteriaCelling(cashierCashbackRuleInfo.getCriteriaCelling());
            /* 返现比例 */
            cashierCashbackRuleInfoBean.setCashbackRatio(cashierCashbackRuleInfo.getCashbackRatio());
            /* 优惠类型 */
            cashierCashbackRuleInfoBean.setDiscountType(cashierCashbackRuleInfo.getDiscountType());
            /* 优惠力度 */
            cashierCashbackRuleInfoBean.setDiscount(cashierCashbackRuleInfo.getDiscount());
            /*            *//* 单日消耗预算 *//*
            cashierCashbackRuleInfoBean.setOprType(cashierCashbackRuleInfo.getoprT);*/

        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("转换营销活动规则信息异常,异常信息:<{}>", byteArrayOutputStream.toString());
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }

        return cashierCashbackRuleInfoBean;
    }

    /**
     * 营销活动支付产品信息数据库实体类和接口实体类数据转换
     *
     * @param mcProductInfo 营销活动产品信息表
     * @return cc.rengu.igas.momp.facade.bean.McProductInfoBean 营销活动产品对象
     * @author Jinan Liu
     * @date 2020/4/1 10:32
     */
    private McProductInfoBean convertMcProductInfo(TMMcProductInfo mcProductInfo) {
        McProductInfoBean mcProductInfoBean = new McProductInfoBean();
        try {
            /* 业务产品代码 */
            mcProductInfoBean.setBizProdCode(mcProductInfo.getBizProdCode());

        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("转换营销活动支付产品信息异常,异常信息:<{}>", byteArrayOutputStream.toString());
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }

        return mcProductInfoBean;
    }

    /**
     * 银行审批员查询营销活动基本信息表数据
     *
     * @param ccbMcListInfoInObj 营销活动列表查询使用实体类入参
     * @return cc.rengu.igas.momp.common.entity.TMPlatBizTmp 业务数据临时表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 19:11
     */
    private TMPlatBizTmp selectCashDetailInfoByBankAuditRole(CcbMcListInfoInObj ccbMcListInfoInObj) throws Exception {
        PlatBizTmpMapper platBizTmpMapper = new PlatBizTmpMapperImpl();
        return platBizTmpMapper.selectCashDetailInfoByBankAuditRole(ccbMcListInfoInObj);
    }

    /**
     * 收银员返现活动基本信息数据库临时表实体类和接口实体类数据转换
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @return cc.rengu.igas.momp.facade.bean.MoneyOffMcInfoBean 减免类活动基本信息对象
     * @author Jinan Liu
     * @date 2020/5/28 20:35
     */
    private CashierCashbackMcInfoBean convertTmpMcInfo(TMPlatBizTmp tmPlatBizTmp) {
        CashierCashbackMcInfoBean cashierCashbackMcInfoBean = new CashierCashbackMcInfoBean();
        try {

            JsonTmpCcbMcInfo jsonTmpCcbMcInfo = JsonOperation.parCcbMcInfoTmpBizData1(tmPlatBizTmp, rglog);

            /* 营销活动编号 */
            cashierCashbackMcInfoBean.setMcNo(jsonTmpCcbMcInfo.getMcNo());
            /* 营销活动名称 */
            cashierCashbackMcInfoBean.setMcName(jsonTmpCcbMcInfo.getMcName());
            /* 营销活动类型 */
            cashierCashbackMcInfoBean.setMcType(jsonTmpCcbMcInfo.getMcType());
            /* 营销活动状态 */
            cashierCashbackMcInfoBean.setMcStatus(jsonTmpCcbMcInfo.getMcStatus());
            /* 活动起始日期 */
            cashierCashbackMcInfoBean.setMcStartDate(jsonTmpCcbMcInfo.getMcStartDate());
            /* 活动截止日期 */
            cashierCashbackMcInfoBean.setMcEndDate(jsonTmpCcbMcInfo.getMcEndDate());
            /* 活动结束日期 */
            cashierCashbackMcInfoBean.setMcActualEndDate(jsonTmpCcbMcInfo.getMcActualEndDate());
            /* 预算 */
            cashierCashbackMcInfoBean.setBudget(jsonTmpCcbMcInfo.getBudget());
            /* 优惠打款模式 */
            cashierCashbackMcInfoBean.setDiscountTransferMode(jsonTmpCcbMcInfo.getDiscountTransferMode());
            /* 达标条件 */
            cashierCashbackMcInfoBean.setCriteriaFlag(jsonTmpCcbMcInfo.getCriteriaFlag());
            /* 有效交易定义 */
            cashierCashbackMcInfoBean.setCriteriaLimit(jsonTmpCcbMcInfo.getCriteriaLimit());
            /* 统计周期 */
            cashierCashbackMcInfoBean.setStatPeriod(jsonTmpCcbMcInfo.getStatPeriod());
            /* 达标交易金额 */
            cashierCashbackMcInfoBean.setCriteriaAmount(jsonTmpCcbMcInfo.getCriteriaAmount());
            /* 达标交易笔数 */
            cashierCashbackMcInfoBean.setCriteriaQuantity(jsonTmpCcbMcInfo.getCriteriaQuantity());
            /* 优惠退出标志 */
            cashierCashbackMcInfoBean.setTerminationFlagPerson(jsonTmpCcbMcInfo.getTerminationFlagPerson());
            /* 交易笔数上限 */
            cashierCashbackMcInfoBean.setQuantityLimitPerson(jsonTmpCcbMcInfo.getQuantityLimitP());
            /* 交易金额上限 */
            cashierCashbackMcInfoBean.setAmountLimitPerson(jsonTmpCcbMcInfo.getAmountLimitP());
            /* 返现金额上限 */
            cashierCashbackMcInfoBean.setCashbackLimitPerson(jsonTmpCcbMcInfo.getCashbackLimitP());
            /* 优惠退出标志 */
            cashierCashbackMcInfoBean.setTerminationFlagMc(jsonTmpCcbMcInfo.getTerminationFlagMc());
            /* 交易笔数上限 */
            cashierCashbackMcInfoBean.setQuantityLimitMc(jsonTmpCcbMcInfo.getQuantityLimitMc());
            /* 交易金额上限 */
            cashierCashbackMcInfoBean.setAmountLimitMc(jsonTmpCcbMcInfo.getAmountLimitMc());
            /* 返现金额上限 */
            cashierCashbackMcInfoBean.setCashbackLimitMc(jsonTmpCcbMcInfo.getCashbackLimitMc());
            /* 交易金额上限 */
            cashierCashbackMcInfoBean.setCashbackMethod(jsonTmpCcbMcInfo.getCashbackMethod());
            /* 审批状态   */
            cashierCashbackMcInfoBean.setAuditStatus(tmPlatBizTmp.getAuditStatus());
            /* 创建人 */
            cashierCashbackMcInfoBean.setOprId(tmPlatBizTmp.getOprId());
            /* 创建时间 */
            cashierCashbackMcInfoBean.setCreateTime(tmPlatBizTmp.getCreateTime());
            /* 最后修改人 */
            cashierCashbackMcInfoBean.setLastOprId(tmPlatBizTmp.getLastOprId());
            /* 修改时间 */
            cashierCashbackMcInfoBean.setUpdateTime(tmPlatBizTmp.getLastUpdateTime());
            /* 审批拒绝原因 */
            cashierCashbackMcInfoBean.setAuditRefuseReason(tmPlatBizTmp.getAuditRefuseReason());
            /* 发布拒绝原因 */
            cashierCashbackMcInfoBean.setPublishRefuseReason(tmPlatBizTmp.getAuditRefuseReason());
            /* 备用字段1 */
            cashierCashbackMcInfoBean.setRemark1(tmPlatBizTmp.getRemark1());
            /* 备用字段2 */
            cashierCashbackMcInfoBean.setRemark2(tmPlatBizTmp.getRemark2());
            /* 备用字段3 */
            cashierCashbackMcInfoBean.setRemark2(tmPlatBizTmp.getRemark3());
            /* 备用字段4 */
            cashierCashbackMcInfoBean.setRemark2(tmPlatBizTmp.getRemark4());
            /* 备用字段5 */
            cashierCashbackMcInfoBean.setRemark2(tmPlatBizTmp.getRemark5());
            //积分规则json字符串
            cashierCashbackMcInfoBean.setPointRuleData(jsonTmpCcbMcInfo.getPointRuleData());

        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("转换营销活动信息异常,异常信息:<{}>", byteArrayOutputStream.toString());
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }

        return cashierCashbackMcInfoBean;
    }

    /**
     * 营销活动机构信息数据库临时表实体类和接口实体类数据转换
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @return cc.rengu.igas.momp.facade.bean.McOrgInfoBean 营销活动机构信息对象
     * @author Jinan Liu
     * @date 2020/5/28 20:01
     */
    private McOrgInfoBean convertTmpMcOrgInfo(TMPlatBizTmp tmPlatBizTmp) {

        McOrgInfoBean mcOrgInfoBean = new McOrgInfoBean();
        try {

            JsonTmpMcOrgInfo jsonTmpMcOrgInfo = JsonOperation.parseTmpMcOrgInfoBizData1(tmPlatBizTmp, rglog);

            /* 机构编号 */
            mcOrgInfoBean.setOrgId(jsonTmpMcOrgInfo.getOrgId());
            /* 机构层级 */
            mcOrgInfoBean.setOrgHierarchy(jsonTmpMcOrgInfo.getOrgHierarchy());
            /* 机构名称 */
            mcOrgInfoBean.setOrgName(jsonTmpMcOrgInfo.getOrgName());

        } catch (Exception e) {
            rglog.error("转换临时表营销活动机构信息异常,异常信息:<{}>", StringUtil.ExceptionToString(e));
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }

        return mcOrgInfoBean;
    }

    /**
     * 营销活动商户信息数据库临时表实体类和接口实体类数据转换
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @return cc.rengu.igas.momp.facade.bean.McMchntInfoBean 营销活动商户信息对象
     * @author Jinan Liu
     * @date 2020/5/28 20:13
     */
    private McMchntInfoBean convertTmpMcMchntInfo(TMPlatBizTmp tmPlatBizTmp) {

        McMchntInfoBean mcMchntInfoBean = new McMchntInfoBean();
        try {

            JsonTmpMcMchntInfo jsonTmpMcMchntInfo = JsonOperation.parseTmpMcMchntInfoBizData1(tmPlatBizTmp, rglog);

            /* 商户范围类型 */
            mcMchntInfoBean.setMchntType(jsonTmpMcMchntInfo.getMchntType());
            /* 商户范围号 */
            mcMchntInfoBean.setMchntNo(jsonTmpMcMchntInfo.getMchntNo());
            /* 商户范围名称 */
            mcMchntInfoBean.setMchntName(jsonTmpMcMchntInfo.getMchntName());

        } catch (Exception e) {
            rglog.error("转换临时表营销活动机构信息异常,异常信息:<{}>", StringUtil.ExceptionToString(e));
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }

        return mcMchntInfoBean;
    }

    /**
     * 营销活动时间信息数据库临时表实体类和接口实体类数据转换
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @return cc.rengu.igas.momp.facade.bean.MoneyOffRuleInfoBean 减免类营销活动规则信息对象
     * @author Jinan Liu
     * @date 2020/5/28 20:30
     */
    private CashierCashbackRuleInfoBean convertTmpMcRuleInfo(TMPlatBizTmp tmPlatBizTmp) {

        CashierCashbackRuleInfoBean cashierCashbackRuleInfoBean = new CashierCashbackRuleInfoBean();

        try {

            JsonTmpCcbMcRuleInfo jsonTmpCcbMcRuleInfo = JsonOperation.parseTmpCcbMcRuleInfoBizData1(tmPlatBizTmp, rglog);

            /* 顺序号  */
            cashierCashbackRuleInfoBean.setRuleIndex(jsonTmpCcbMcRuleInfo.getRuleIndex());
            /* 优惠力度下限 */
            cashierCashbackRuleInfoBean.setCriteriaFloor(jsonTmpCcbMcRuleInfo.getCriteriaFloor());
            /* 优惠力度上限 */
            cashierCashbackRuleInfoBean.setCriteriaCelling(jsonTmpCcbMcRuleInfo.getCriteriaCelling());
            /* 返现比例 */
            cashierCashbackRuleInfoBean.setCashbackRatio(jsonTmpCcbMcRuleInfo.getCashbackRatio());
            /* 优惠类型 */
            cashierCashbackRuleInfoBean.setDiscountType(jsonTmpCcbMcRuleInfo.getDiscountType());
            /* 优惠力度 */
            cashierCashbackRuleInfoBean.setDiscount(jsonTmpCcbMcRuleInfo.getDiscount());

        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("转换营销活动规则信息异常,异常信息:<{}>", byteArrayOutputStream.toString());
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }

        return cashierCashbackRuleInfoBean;
    }

    /**
     * 营销活动产品信息数据库临时表实体类和接口实体类数据转换
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @return cc.rengu.igas.momp.facade.bean.McProductInfoBean 营销活动产品对象
     * @author Jinan Liu
     * @date 2020/5/28 20:29
     */
    private McProductInfoBean convertTmpMcProductInfo(TMPlatBizTmp tmPlatBizTmp) {
        McProductInfoBean mcProductInfoBean = new McProductInfoBean();
        try {

            JsonTmpMcProdInfo jsonTmpMcProdInfo = JsonOperation.parseTmpMcProdInfoBizData1(tmPlatBizTmp, rglog);

            /* 业务产品代码 */
            mcProductInfoBean.setBizProdCode(jsonTmpMcProdInfo.getBizProdCode());

        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("转换营销活动支付产品信息异常,异常信息:<{}>", byteArrayOutputStream.toString());
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }

        return mcProductInfoBean;
    }
}
